package com.deercrowing.takeaway.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.deercrowing.takeaway.entity.OrderDetailEntity;
import com.deercrowing.takeaway.entity.OrdersEntity;
import com.deercrowing.takeaway.vo.OrderPaymentVO;
import com.deercrowing.takeaway.vo.OrdersPageVO;
import com.deercrowing.takeaway.vo.OrdersStatusNumberVO;
import com.deercrowing.takeaway.vo.OrdersVO;

import java.util.List;


/**
 * 订单表(Orders)表服务接口
 *
 * @author guoyongxiang
 * @since 2024-07-11 16:04:43
 */
public interface OrdersService extends IService<OrdersEntity> {

    /**
     * 按搜索条件搜索信息
     *
     * @param ordersPageVO
     * @return
     */
    IPage<OrdersVO> searchByCondition(OrdersPageVO ordersPageVO);

    /**
     * 统计订单待接单、已接单、派送中数量
     *
     * @return
     */
    OrdersStatusNumberVO searchByStatus();

    /**
     * 订单接单
     *
     * @param ordersVO
     */
    void ordersByConfirm(OrdersVO ordersVO);

    /**
     * 查询订单详情
     *
     * @param id
     * @return
     */
    OrdersVO searchById(Long id);

    /**
     * 订单取消
     *
     * @param ordersVO
     */
    void ordersByCancel(OrdersVO ordersVO) throws Exception;

    /**
     * 订单拒单
     *
     * @param ordersVO
     */
    void ordersByRejection(OrdersVO ordersVO);

    /**
     * 订单完成
     *
     * @param id
     * @param status
     */
    void ordersByComplete(Long id, Short status);

    /**
     * 订单派送
     *
     * @param id
     * @param status
     */
    void ordersByDelivery (Long id, Short status);

    /**
     * 用户历史订单
     *
     * @param ordersPageVO
     * @return
     */
    IPage<OrdersVO> userOfHistoryOrders(OrdersPageVO ordersPageVO);

    /**
     * 提交订单
     *
     * @param ordersVO
     */
    OrdersVO orderSubmit(OrdersVO ordersVO);

    /**
     * 支付订单
     *
     * @param orderNumber
     */
    OrderPaymentVO orderPayment(String orderNumber) throws Exception;

    /**
     * 支付成功、修改订单状态
     *
     * @param outTradeNo
     */
    void paySuccess(String outTradeNo);

    /**
     * 查找订单详情信息
     *
     * @param id
     * @return
     */
    OrdersVO searchOrderDetailByOrderId(Long id);

    /**
     * 用户催单
     *
     * @param id
     */
    void userOfReminder(Long id);

    /**
     * 再来一单
     *
     * @param id
     */
    void userOfRepetition(Long id);

    /**
     * 用户取消
     *
     * @param id
     */
    void userByCancel(Long id) throws Exception;
}

